﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="LocHoaDon.aspx.cs"
    Inherits="HoaDon.LocHoaDon" Title="Tìm kiếm hóa đơn" %>

<asp:Content ID="cthoadon" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>

    <script type="text/javascript">
    $(document).ready(function () {
        $("#<%=dttuNgay.ClientID %>").dynDateTime({
            showsTime: true,
            ifFormat: "%d/%m/%Y",
            daFormat: "%l;%M %p, %e %m,  %Y",
            align: "BR",
            electric: false,
            singleClick: false,
            displayArea: ".siblings('.dtcDisplayArea')",
            button: ".next()"
        });
        
    });
        $(document).ready(function () {
        $("#<%=dtdenNgay.ClientID %>").dynDateTime({
            showsTime: true,
            ifFormat: "%d/%m/%Y",
            daFormat: "%l;%M %p, %e %m,  %Y",
            align: "BR",
            electric: false,
            singleClick: false,
            displayArea: ".siblings('.dtcDisplayArea')",
            button: ".next()"
        });
        
    });
    </script>

    <asp:Table runat="server" Width="327px" Style="height: 144px">
        <asp:TableRow>
            <asp:TableCell>Từ ngày</asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="dttuNgay" runat="server" Width="200px"></asp:TextBox>
                <img src="images/calender.png" /></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell>Đến ngày</asp:TableCell>
            <asp:TableCell>
                <asp:TextBox ID="dtdenNgay" runat="server" Width="200px"></asp:TextBox>
                <img src="images/calender.png" /></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell>Nhân viên</asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="drnhanvien" runat="server" Width="202px">
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell>Cửa hàng</asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="drcuahang" runat="server" Width="202px">
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell>Khu vực</asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="drkhuvuc" runat="server" Width="202px" AutoPostBack="true"
                    OnSelectedIndexChanged="drkhuvuc_SelectedChanged">
                </asp:DropDownList>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell>Bàn</asp:TableCell>
            <asp:TableCell>
                <asp:DropDownList ID="drban" runat="server" Width="202px">
                </asp:DropDownList>
                <asp:CheckBox ID="ckAll" runat="server" ToolTip="Tìm kiếm cả các hóa đơn chưa được thanh toán">
                </asp:CheckBox>
            </asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell></asp:TableCell>
            <asp:TableCell>
                <asp:Button ID="btOk" runat="server" Text="Xử lý" Width="75px" CssClass="my_btn_ok"
                    OnClick="btOk_Click" />
                &nbsp;
                <asp:Button ID="btIn" runat="server" Text="In" Width="75px" CssClass="my_btn_ok"
                    OnClick="btIn_Click" />
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:GridView ID="gdxdshoadon" runat="server" AutoGenerateColumns="false" CssClass="GridViewInvoice">
                <Columns>
                    <asp:TemplateField HeaderText="Mã tự động">
                        <ItemTemplate>
                            <asp:Label ID="Stt_Rec" runat="server" Text='<%# 
Eval("Stt_Rec") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày ct">
                        <ItemTemplate>
                            <asp:Label ID="Ngay_ct" runat="server" Text='<%# 
String.Format("{0: dd/MM/yyyy}", Eval("Ngay_ct")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Bàn">
                        <ItemTemplate>
                            <asp:Label ID="vvName" runat="server" Text='<%#
Eval("vvName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tiền hàng">
                        <ItemTemplate>
                            <div style="text-align: right;">
                                <asp:Label ID="Tien_hang" runat="server" Text='<%#
Eval("Tien_hang", "{0:#,#}") %>'></asp:Label>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tiền CK">
                        <ItemTemplate>
                            <div style="text-align: right;">
                                <asp:Label ID="Tien_ck" runat="server" Text='<%#
Eval("Tien_ck", "{0:#,#}") %>'></asp:Label>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Tổng tiền">
                        <ItemTemplate>
                            <div style="text-align: right;">
                                <asp:Label ID="T_Tien" runat="server" Text='<%#
Eval("T_Tien", "{0:#,#}") %>'></asp:Label>
                            </div>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Người tạo">
                        <ItemTemplate>
                            <asp:Label ID="user_id0" runat="server" Text='<%# 
Eval("user_id0") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày tạo">
                        <ItemTemplate>
                            <asp:Label ID="datetime0" runat="server" Text='<%# 
String.Format("{0: dd/MM/yyyy}", Eval("datetime0")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Người sửa">
                        <ItemTemplate>
                            <asp:Label ID="user_id2" runat="server" Text='<%# 
Eval("user_id2") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày sửa">
                        <ItemTemplate>
                            <asp:Label ID="datetime2" runat="server" Text='<%# 
String.Format("{0: dd/MM/yyyy}", Eval("datetime2")) %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Thao tác">
                        <ItemTemplate>
                            <asp:ImageButton ID="btXem" runat="server" CommandArgument='<%# 
Eval("Stt_Rec")+"_"+Eval("T_Tien") %>' OnClick="btXem_Click" ImageUrl="~/images/view.png"></asp:ImageButton>
                            <asp:ImageButton ID="btXoa" runat="server" ImageUrl="~/images/delete.png" CommandArgument='<%# 
Eval("Stt_Rec") %>' OnClick="btXoa_Click"></asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btOk" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
